#include "stdafx.h"
#include "..\stdafx.h"

#include "StringPtrDictionary.h"



bool __stdcall IsStringPtrEqual(StringPtr *pstrA, StringPtr *pstrB)
{
	return pstrA->n == pstrB->n && !memcmp(pstrA->pwh, pstrB->pwh, 2 * pstrA->n);
}

XUINT32 ComputeStringPtrHash(StringPtr *pstr, XUINT32 hashSeed)
{
	wchar_t *chrrPos;
	XUINT32 result;

	chrrPos = pstr->pwh;
	result = hashSeed;
	while ( chrrPos < &pstr->pwh[pstr->n] )
	{
		result = *chrrPos ^ 33 * result;
		++chrrPos;
	}
	return result;
}